1. Field of the Invention
The present invention relates to technology for playing data streams that include video and audio data, particularly technology that omits the adjustment of a reference clock used in video and audio playback.
2. Related Art
In recent years MPEG-2 (Moving Picture Experts Group 2) has become widely used as an encryption method for moving image signals in digital television broadcasts and the like.
MPEG-2 standards stipulate a transport stream (TS) used in broadcasts and so forth as a data stream.
An encoder encodes, according to MPEG-2 video/audio encoding standards, audio or video constituting a program to create an elementary stream (ES).
The encoder then divides the elementary stream into decode/playback units (single frames for video, single audio frames for audio) based on MPEG-2 standards, and appends a header that includes a decoding time stamp (DTS) showing a decoding time and a presentation time stamp (PTS) showing a playback time to each decode/playback unit, to create packetized elementary stream (PES) packets.
The encoder divides the PES packets into 184-byte units and appends a 4-byte header to create 188-byte TS packets. The encoder time-division multiplexes TS packets relating to one or a plurality of programs to create a transport stream.
The encoder multiplexes program specific information (PSI) onto transport streams. PSI is organized in a table format stipulated by MPEG standards, and includes program information such as program title, starting time and ending time, and information showing which packets to extract and how to decode extracted packets when arbitrary programs are selected for playback from a plurality of multiplexed programs.
A decoder, in the opposite order to the encoder, creates TS packets from inputted transport streams, and creates PES packets from the TS packets.
The decoder counts a system time clock (STC), being a synchronous signal used in the decoding/playback of video and audio, in sync with a 27-MHz clock provided in the decoder, and decodes decode/playback units when the DTS of respective decode/playback units matches the STC value.
The decoder outputs (i.e. plays) decode/playback units when the PTS of respective decode/playback units matches the STC value.
When there is a discrepancy between the frequencies of clocks used respectively by the encoder and decoder as a basis for encoding and decoding, inconsistencies arises between the amounts of a data stream inputted to and processed by the decoder per unit time. This causes underflows or overflows, both types of buffer errors, in buffers for holding the inputted amount of the data stream, which may in turn result in frame freeze whereby the same frame is played two or more times, or frame skipping whereby frames that should be played are not (see Interface, CQ publishing, January 2000, p.117).
To avoid these inconsistencies, the decoder uses a phase lock loop (PLL) circuit, which is a type of closed feedback circuit constituted by a phase comparator, a low-pass filter, a voltage control oscillator and so forth, to bring the clock frequency of the decoder in line with the clock frequency of the encoder (see The Latest on MPEG, edited by the Multimedia Communications Research Group, ASCII Publishing, Dec. 21, 1995, pp.235-238).
Program clock references (PCRs), which are pieces of time information for adjusting the decoder clock frequency to a frequency intended by the encoder, are appended intermittently in transport streams. Every time a PCR is received, the decoder uses the PLL circuit to convert the difference between the PCR value and the STC value to a voltage. The decoder increases or decreases the clock frequency of the decoder in response to the voltage, thereby obtaining the clock frequency intended by the encoder.
However, when decoder clock frequency adjustment by the PLL circuit lacks precision, or a fixed-frequency crystal oscillator not capable of frequency adjustment is used in place of the PLL circuit to reduce costs, for example, the above-mentioned inconsistencies between the amounts of a data stream inputted to and processed by the decoder per unit time occur. As mentioned above, this causes underflows or overflows in buffers for holding the inputted amount of the data stream, which may in turn result in the freezing or skipping of frames.
In view of these problems, the present invention aims to provide a serviceable data stream playback device that is capable of playing image and audio data in a state in which any deterioration in image or sound quality is reduced, even when adjusting for discrepancies between a clock of the decoder and a system clock of the encoder is not possible.